package com.jicheng.mapper;

import com.jicheng.dto.user.UserDto;
import com.jicheng.dto.user.UserPagingParams;
import com.jicheng.entity.SuperviseUser;
import com.jicheng.framework.mybatis.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SuperviseUserMapper extends BaseMapper<SuperviseUser> {

    /**
     * 获取用户列表
     * @param params
     * @return
     */
    List<UserDto> getList(UserPagingParams params);

    /**
     * 获取用户总数
     * @param params
     * @return
     */
    long getCount(UserPagingParams params);

    @Select("select count(1) from tb_app_user where app_id = #{appId}")
    int exist(String appId);
}